package com.example.mapper;

import com.example.pojo.Hospital;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface HospitalMapper {
    @Select("SELECT * FROM hospital")
    List<Hospital> getAllHospitals();

    @Select("SELECT COUNT(*) FROM hospital")
    int getTotalHospitalCount();

    @Select("SELECT hpId, name, picture, telephone, address, businessHours, deadline, rule, state " +
            "FROM hospital WHERE hpId = #{hpId}")
    Hospital getHospitalById(Integer hpId);

    @Select("SELECT * FROM hospital WHERE hp_id = #{hpId}")
    Hospital selectOneByHpId(Integer hpId);


    Hospital selectById(Integer hpId);
}

